UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OeUi+EF3t13WOi2pRmDwqcQ9kiHVgG8rIv2JS+5+VYA='
WHERE
key_id = '089123631444a95ddff6c4ad4e2321057784abfda9ecd488bb124e5f718ec6a9'
AND (
token = 'OeUi+EF3t13WOi2pRmDwqcQ9kiHVgG8rIv2JS+5+VYA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)