UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'g2tRFjpZI/kIJe8ZprNouZXbdHhrQl27QNby6GuYbmw=' 
WHERE 
  key_id = '7f906ed2c6cb8c270d631560d9ea9911c68f360d6790f48502a0263e87832abb' 
  AND (
    token = 'g2tRFjpZI/kIJe8ZprNouZXbdHhrQl27QNby6GuYbmw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025