UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XWT9zJJ7Ak5EuQgq3FGc2bkKmaNw2elp9xmZZHfRLrg=' 
WHERE 
  key_id = 'd423ef74828df27e9f7b6ccf90f3a1a9fd8172f95d1b4b2cb1d247b20c01a0f3' 
  AND (
    token = 'XWT9zJJ7Ak5EuQgq3FGc2bkKmaNw2elp9xmZZHfRLrg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019