UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2tJlarlHapGsgW0Z2UQYIETcSemHXHy1twoKw6aKwnI='
WHERE
key_id = '32f8139f5531ccd7400891a23a11348e7422ce96b5fa728e89988140b0cd7fcd'
AND (
token = '2tJlarlHapGsgW0Z2UQYIETcSemHXHy1twoKw6aKwnI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)