UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kiMDCHW9DGq3LmL9UB90P/hVHnWK6G1npvh2+M5D6Os='
WHERE
key_id = '297a5b2381e335c90dfad74adf4d8d8698ea3c2a505d93aa4fd6385b023c70ed'
AND (
token = 'kiMDCHW9DGq3LmL9UB90P/hVHnWK6G1npvh2+M5D6Os='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)