UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HbyeLx6sJLJfQ7eip2Rqmb3aCAf4GQUklsI6Da//Tg0=' 
WHERE 
  key_id = '6e18bac033e88f0ff9bc00c2bc23658f649bb90e2d315ab8fd80c9499e9be937' 
  AND (
    token = 'HbyeLx6sJLJfQ7eip2Rqmb3aCAf4GQUklsI6Da//Tg0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025