UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yHZBtJzhGjsQv3OlpdOi3jK7xxk5joXShCC9uzB70rs='
WHERE
key_id = '7267e6e7c9572af3776c4ebc517935b8db9d54d5aa1adbd2e17dc717ba08bc96'
AND (
token = 'yHZBtJzhGjsQv3OlpdOi3jK7xxk5joXShCC9uzB70rs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)