UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MbL1pUGEWlt2paMlFhH7q3TDeXDsbDjbaNclmlIYHl0='
WHERE
key_id = '8439428a1109d236e06fffd9b092a5caec19869fef6fe3ba4c1badcf889e8de6'
AND (
token = 'MbL1pUGEWlt2paMlFhH7q3TDeXDsbDjbaNclmlIYHl0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)