UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kGIILq2iuEdhetewFIq4zt4hVuMyMaNSd5sp3vTX9RY=' 
WHERE 
  key_id = '57f28aab63e881708f0846684d533a305e439afd0aff654179517ef1a61b5d95' 
  AND (
    token = 'kGIILq2iuEdhetewFIq4zt4hVuMyMaNSd5sp3vTX9RY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025