UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '61ltN3+mouPVpelhEXMcW3tPu5OFDJlydXiMmEMGreE='
WHERE
key_id = 'fe4e299e15d38e6f52310517c8cbe727b6f9b8209d4f7990664d42f89f45bda8'
AND (
token = '61ltN3+mouPVpelhEXMcW3tPu5OFDJlydXiMmEMGreE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)