UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DBGET2zQYB9H8Y4p/CbFDB1N+r3C5qVc5Gp/Ln35f4c=' 
WHERE 
  key_id = 'c7c22f9fc78de0bedc229fbb39fcd9a724b54e7d80b7b1e896a77942b1f71089' 
  AND (
    token = 'DBGET2zQYB9H8Y4p/CbFDB1N+r3C5qVc5Gp/Ln35f4c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027