UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rFNZp/uLUOEpSjfwMYxANuCNB3PA+SdjnwfNmSgDbuw='
WHERE
key_id = '54d0988dfdf178ddf17493aa22bd08bb7bb123be85bca3fa0656494e2680cce9'
AND (
token = 'rFNZp/uLUOEpSjfwMYxANuCNB3PA+SdjnwfNmSgDbuw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)