UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CFhiGtjYe+CXg9ur8Oe2V6q4t8DAjZncJZUVpCkPIyw=' 
WHERE 
  key_id = '00ca8001d19e4d4b8eeb97fa3c9f96e1572284a6cf90127fb5ba477ae07b1f11' 
  AND (
    token = 'CFhiGtjYe+CXg9ur8Oe2V6q4t8DAjZncJZUVpCkPIyw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029