UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xUemAp6Vhta6u4rwN64uHqukdVXdzpNlq48oa6AmvdM='
WHERE
key_id = 'bace4f054105bb29d798eeb0bc89e02a13278cc174075b631d8a50f8f86f6cbc'
AND (
token = 'xUemAp6Vhta6u4rwN64uHqukdVXdzpNlq48oa6AmvdM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)