UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bLzIyPG2sBqG0gxiXwLtineEWsQbYWZV+QIrA1UZMzE=' 
WHERE 
  key_id = '551d876d60164302fb2c80332081b5d3b1c8f081521728e94d50116dcd69cb2c' 
  AND (
    token = 'bLzIyPG2sBqG0gxiXwLtineEWsQbYWZV+QIrA1UZMzE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018