UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sHLqQWoU/Li90mIPHd7Pm2L+m0+FYbsIGAygcLnZQ94=' 
WHERE 
  key_id = '3a22dc50dbefe25ceb064b5a0a8464d2d903296ab8990f28c09b0373b4d2785d' 
  AND (
    token = 'sHLqQWoU/Li90mIPHd7Pm2L+m0+FYbsIGAygcLnZQ94=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039