UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dfR9wvk+1DCJXIV7oJD63B847UjiYxBLwALHvTQuKVs='
WHERE
key_id = 'b7033fc39f0098091aa779d86b767fc56679e78807604ae30033af5040502273'
AND (
token = 'dfR9wvk+1DCJXIV7oJD63B847UjiYxBLwALHvTQuKVs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)