UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XBtLZhQ2vCZlo/GK77Pss7HDhnAeRq/ledINQGA6USU=' 
WHERE 
  key_id = 'b1303632a82609353eefe53791367025587284c1a11a3b1796bb4b896b320b12' 
  AND (
    token = 'XBtLZhQ2vCZlo/GK77Pss7HDhnAeRq/ledINQGA6USU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057