UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+5OUvL8iNzm40glrqXU8OVojWS6/d8Yoz30IFgoJ3Z0='
WHERE
key_id = '33cb497dac8ef9f6114919b5c6fbf5cbdfee82e4a03653db7ff8a067f5db76da'
AND (
token = '+5OUvL8iNzm40glrqXU8OVojWS6/d8Yoz30IFgoJ3Z0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)