UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rc+xSo8pZnwblTx/UnCigg1rXD4WME8NlI1XH7IDrcY='
WHERE
key_id = '45fe16067cee24bc922143d721690a20fa8c5d90c1e92a53888b49880234ca29'
AND (
token = 'rc+xSo8pZnwblTx/UnCigg1rXD4WME8NlI1XH7IDrcY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)