UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YXIM0QHGCs3qO4N7ZAOve3zNe7SVEAV8UtXiYHtxKAs=' 
WHERE 
  key_id = 'fa609cffc27dfe9cd6c43be3aa4242e43bc6c1292534940e7d80b261e55cd65c' 
  AND (
    token = 'YXIM0QHGCs3qO4N7ZAOve3zNe7SVEAV8UtXiYHtxKAs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046