UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3kycGEjDelFpA0l9AcTIeyC171W5DJVgE5CrTWZvNL0='
WHERE
key_id = '6f38fd074b597406c61111c1b165ed1fcd49809337054b447acc776595f03c36'
AND (
token = '3kycGEjDelFpA0l9AcTIeyC171W5DJVgE5CrTWZvNL0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)