UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Nz70MaXkeSRntPeE2os3g4+aPSxT7+5HjsdhTcQsByE=' 
WHERE 
  key_id = 'a53c77d9989e392f5e22bdb6fc51190f4c10884a75b782b6b3b56bcc5510d19f' 
  AND (
    token = 'Nz70MaXkeSRntPeE2os3g4+aPSxT7+5HjsdhTcQsByE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016