UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'owzwgOsWgpN0Mn5sGvuWjiutEB/7hjc0rog5RwOF28U='
WHERE
key_id = '4461d51093ff0ec7832e4f6ee6eb985a51555ef0f8d05a4174ca6c6f751ad18f'
AND (
token = 'owzwgOsWgpN0Mn5sGvuWjiutEB/7hjc0rog5RwOF28U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)