UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0SLNNYyUvavPkxdiDkh5UTC5cQxoepjSrHLG8KjkuAY='
WHERE
key_id = 'eb95818c0437af687842235b318bbead7c0dff0d85e7f9ecfe85506feeeb071b'
AND (
token = '0SLNNYyUvavPkxdiDkh5UTC5cQxoepjSrHLG8KjkuAY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)