UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OnAVeNwlM6Oj4OUSZeOa/zXV0BqoEEYfKSQU4449zPw=' 
WHERE 
  key_id = '9e0e1c72d1d016dad10aa021d3ad375ce8cc2c01fa698cb043bfb923a259d3f5' 
  AND (
    token = 'OnAVeNwlM6Oj4OUSZeOa/zXV0BqoEEYfKSQU4449zPw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016