UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fwUKnCjFH8bVL6lzkk7QvtS+x3kw4ZV6b3N0vGlR2Ic='
WHERE
key_id = 'de2b7378283c0c4c9bf9b277df04e4a183117e4cfefe263fc23bd36e8700a20b'
AND (
token = 'fwUKnCjFH8bVL6lzkk7QvtS+x3kw4ZV6b3N0vGlR2Ic='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)