UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SWvSlH0l/exUPaIH8yrRkyaskds1NpauvPGu4v9vWjk='
WHERE
key_id = '6c6198aae326495b49aaf9cfb5f8bbdb657ca253348f1f4923e57dbd98da1611'
AND (
token = 'SWvSlH0l/exUPaIH8yrRkyaskds1NpauvPGu4v9vWjk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)