UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+xmRk2YOLKfzJXaLF2H1mnzlJAKFSLOafVhks2CTLZA='
WHERE
key_id = '1d424e05e93adbac65371671fbaaac82b89b079220ef4e3cedcd727eee259ff7'
AND (
token = '+xmRk2YOLKfzJXaLF2H1mnzlJAKFSLOafVhks2CTLZA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)