UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QtnZn1Pw3z3TzIIZW/pNxbc32LhBWC+roEOgi/RMJeU='
WHERE
key_id = '68e850795ca98b6654ed070c1a33107654dea525c3cb194d79162c24611cd83e'
AND (
token = 'QtnZn1Pw3z3TzIIZW/pNxbc32LhBWC+roEOgi/RMJeU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)