UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mfDCLZZwzUxEnjbMNBi19v1aUimWU3gZQTCePMzgbbQ='
WHERE
key_id = '66e49ba4e68e28161f516bbabbf4d5ffa6f14a12d1b58ee41fb953d07d683711'
AND (
token = 'mfDCLZZwzUxEnjbMNBi19v1aUimWU3gZQTCePMzgbbQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)