UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ojFRY8DlMawPmSkFg2NrZ4+nrImAhSC8waf0FA9pMmU='
WHERE
key_id = 'b97ca3d3d660e6ce2d159dbfd01d72e458fad0502a125a69cd06213f5e21f8f0'
AND (
token = 'ojFRY8DlMawPmSkFg2NrZ4+nrImAhSC8waf0FA9pMmU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)