UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xKHETkgLud5CwdsYKtmYDjXrqHHIwJu8bAR5xPSAFoY='
WHERE
key_id = '2e66acf67e1430c3ae2f1a8244662162709a3cea4e14cbc12364231875b1afe6'
AND (
token = 'xKHETkgLud5CwdsYKtmYDjXrqHHIwJu8bAR5xPSAFoY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)