UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DOfTUsGg7dRNvoBH/XS6Xams1+n+6OEUk2Aa3v2DhX8='
WHERE
key_id = '5b54f1c4203e74b030f271ae9459714b33ac0174323637ae74a11e9676b7470f'
AND (
token = 'DOfTUsGg7dRNvoBH/XS6Xams1+n+6OEUk2Aa3v2DhX8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)