UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4tScUB2tDSvqx+0tek+49JvXVkMsMAUDfJJ5QLe/63E=' 
WHERE 
  key_id = '57135f9cc4230351d28a3393e021f195cdd74fb188d3eae84415ed53cfd0033a' 
  AND (
    token = '4tScUB2tDSvqx+0tek+49JvXVkMsMAUDfJJ5QLe/63E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044