UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HIpfumwoRwAXL0VPFkNTcarO+YAkUgjtHFjkO1ZOaWk='
WHERE
key_id = '291a3115de2afd70743f7e2604a4c3b20cc6f077bdbbcc13f41b253e5d6fc848'
AND (
token = 'HIpfumwoRwAXL0VPFkNTcarO+YAkUgjtHFjkO1ZOaWk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)