UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mkv42vAWJGxOdONVvqCH3FHVbCVAGRZ/9v+ZwEeHw00=' 
WHERE 
  key_id = '905d9944ef905334910a9bd1427a9eccee5f01823977750b2bf32a4debb4775c' 
  AND (
    token = 'mkv42vAWJGxOdONVvqCH3FHVbCVAGRZ/9v+ZwEeHw00=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027