UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dgwuoXoH+PkEl0KMy9cd1U7qYrar0cVd26/v++Jm/rM='
WHERE
key_id = '1a5a3979d5c706b1a02fb9f7b2f407b2a10f869580a3f4cb5e80c89bb9865eac'
AND (
token = 'dgwuoXoH+PkEl0KMy9cd1U7qYrar0cVd26/v++Jm/rM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)