UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'j352kHZky1oL56c6zgFtPWJPHh35hEHK3zLJ34ylnjE='
WHERE
key_id = '15e873da0eb548340303f5c52092fdcbd9b6446b9946f6bcdc00ef5cb577270e'
AND (
token = 'j352kHZky1oL56c6zgFtPWJPHh35hEHK3zLJ34ylnjE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)