UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gvu3TyRJh1dDE+IfN6Fs/QnCaFZleO69pbhZG/2uGlY=' 
WHERE 
  key_id = '273a473302b81c589f85c838a8adba5f49d707d40529f81f0b0328de1849742a' 
  AND (
    token = 'gvu3TyRJh1dDE+IfN6Fs/QnCaFZleO69pbhZG/2uGlY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022