UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gvXT57G1HQxVOeT3Is4OKH11yarGgTCzsiaBrSpzzTA='
WHERE
key_id = '922df5951ba31824a09b11dbadff3bb4e9b482ff018f8c9cce30bd659919923f'
AND (
token = 'gvXT57G1HQxVOeT3Is4OKH11yarGgTCzsiaBrSpzzTA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)