UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'r9h5u5de7WHxv0H2AIwmuDK9VqlOEnOpacJOoSmuG3U='
WHERE
key_id = '6875f93c8cc34bf4238108caca58fe549dc8a7115ea143f72a6082cf83cd06f6'
AND (
token = 'r9h5u5de7WHxv0H2AIwmuDK9VqlOEnOpacJOoSmuG3U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)