UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3kmRfD9U+/alSoedFfJm6nal7vgZ2S9f7RFpM2ig004=' 
WHERE 
  key_id = '932f42088b29b6fbd24a975dfa2e4d0597dee4f5238ccc5a301bcb747fe791dc' 
  AND (
    token = '3kmRfD9U+/alSoedFfJm6nal7vgZ2S9f7RFpM2ig004=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038