UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oENuG5Y6c+3GmMGG8LTZ6y5WYJ65Y5xpw+rphXDTdAY='
WHERE
key_id = 'ca5ad04034ac9990efcf74c140a19b7593324a247f4d968b07e89511f8288875'
AND (
token = 'oENuG5Y6c+3GmMGG8LTZ6y5WYJ65Y5xpw+rphXDTdAY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)