UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sqEFO2OUMbrRG3/8GrV442Wzs+SL3R7nCF+4X3GYRqo=' 
WHERE 
  key_id = '7f5191c13cd4f87ceca4b16188336a1eb9a8bef86c1f1d9706fb0faf0d0acb24' 
  AND (
    token = 'sqEFO2OUMbrRG3/8GrV442Wzs+SL3R7nCF+4X3GYRqo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035